layui.define(function (exports) {
    var a = layui.jquery,
        f = layui.form,
        t = layui.table,
        ly = layui.layer,

        T = {
            method: {
                // +----------------------------------------------------------------------
                // | 自定义顶部按钮方法
                // +----------------------------------------------------------------------
                top: {

                },
                // +----------------------------------------------------------------------
                // | 自定义右侧按钮方法
                // +----------------------------------------------------------------------
                right: {
                    /** 会员登录 */
                    login: function (data, tool, obj) {
                        ly.confirm('确定要登录吗？', {title: '请确认'}, function (index) {
                            layui.listen.method.load();
                            a.post(tool.url, {id: data.id, tableUniqueTitle: tool.unity_title}, function (data) {
                                ly.closeAll();
                                if (data.code === 1) {
                                    parent.layer.open({
                                        type: 2,
                                        area: ['390px', a(window).height() < 800 ? (90 + '%') : (800 + 'px')],
                                        anim: 2,
                                        offset: 'rb',
                                        shade: 0,
                                        title: '<a  href="' + data.data.url + '" target="_blank" >当前登录 《 ' + data.data.code + '》 右键可选择新窗口打开</a>',
                                        content: "" + data.data.url + "",
                                    });
                                } else {
                                    notify.error(data.msg);
                                }
                            })
                        });
                    }
                }
            },
        };

    exports('handle', T);
});